USE [NANS21V]
GO

/****** オブジェクト: SqlProcedure [dbo].[RoundCount] スクリプト日付: 2014/06/05 16:51:24 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[RoundCount]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[RoundCount]
GO

CREATE PROCEDURE [dbo].[RoundCount]
	@TAIKAINO int,
	@KYOGINO int,
	@SUBNO int,
	@ROUNDNO int
AS
SELECT 
	R.ROUNDNO,
	R.KUMIWAKEFLG
FROM 
	TBL_ROUND AS R 
WHERE 
	R.TAIKAINO = @TAIKAINO 
	AND R.KYOGINO = @KYOGINO 
	AND R.SUBNO = @SUBNO
	AND R.ROUNDNO > @ROUNDNO